#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :get_viewlist.py
# @Time      :2023/10/25 
# @Author    :CL
# @email     :1037654919@qq.com

import requests

def get_viewlist():
    headers = {
        "Accept": "application/json, text/javascript, */*; q=0.01",
        "Accept-Language": "zh-CN,zh;q=0.9",
        "Cache-Control": "no-cache",
        "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
        "Origin": "http://www.lvmama.com",
        "Pragma": "no-cache",
        "Proxy-Connection": "keep-alive",
        "Referer": "http://www.lvmama.com/lvyou/scenery/d-beijing1.html",
        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
        "X-Requested-With": "XMLHttpRequest"
    }
    cookies = {
        "_ip_city_name": "%E4%B8%8A%E6%B5%B7",
        "_ip_city_place_id": "310000",
        "_ip_province_place_id": "310000",
        "uid": "wKgKb2U4c6DB6FY8N2IDAg==",
        "lvsessionid": "5e91e5ff-40d7-44d8-80c7-93b29dc8e917_16864194",
        "sajssdk_2015_cross_new_user": "1",
        "sensorsdata2015jssdkcross": "%7B%22distinct_id%22%3A%2218b6483ae6e583-00a9889c6d2904-13462c6c-2073600-18b6483ae6f94b%22%2C%22%24device_id%22%3A%2218b6483ae6e583-00a9889c6d2904-13462c6c-2073600-18b6483ae6f94b%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%7D",
        "BDCCOOKIEID": "hrBhePbj3980950582",
        "BDCSESSIONID": "rSjdsWfeSHy1698217649443",
        "CoreID6": "88359017514216982176497&ci=52710000|PC",
        "Hm_lvt_cb09ebb4692b521604e77f4bf0a61013": "1698217650",
        "fp_ver": "4.5.1",
        "_ga": "GA1.2.481363095.1698217651",
        "_gid": "GA1.2.875696478.1698217651",
        "_jzqc": "1",
        "_jzqckmp": "1",
        "PHPSESSID": "21rbooo9huibt9r0drchq3h2h0",
        "cmTPSet": "Y",
        "_lvTrack_u_ud": "B014A4D3-920F-4CA4-A91C-ACAE28A90E01",
        "_qzjc": "1",
        "LVMM_NODE_ENV": "production",
        "oIC": "233198233198233198233198",
        "oIT": "0925092509250925",
        "_jzqa": "1.478980885840175800.1698217652.1698217652.1698222597.2",
        "_lvTrack_u_sd": "4724BA09-0A8A-4A31-A1AC-AD6200796898",
        "_lvTrack_firstVisitTime": "1698222597421",
        "_lvTrack_preVisitTime": "1698222664977",
        "__xsptplus443": "443.2.1698222663.1698222928.2%234%7C%7C%7C%7C%7C%23%23%23",
        "jXVJUTNgMEfp6rEr": "JGWan2X1zbabx91ppBgBdd%2BRDt4AbL310DOL1EiEjboT0QpZ2JY0%2BcVDpb5p7WQ3kFaP66Zrj%2B%2Ftg1BkC8J0UZVd7eRfL6oHu%2B1VNr1FOpiUuc0SUIr3tDvS2bDywKuOg8Hs5uyBAq428s7XYW4oPv23gVkNxHhxF08guJVLKMdbGxO7R3GowLhfLwdmrgoF1M5n%2BDPTjv9tZsARSFdeydeNxN1%2BWaiySwN26QbOhVsHsOZRHrk9rdt%2BRqTeo6M4%2Bu0LD1DAwCA3uMsnyR9RvqBeZnVrgQIVJmbmujIv7abW6paegTxAnafKTYWBCljFjudRCJy45lE%2BP8Pa2Vqznf4UFwbwbN%2BemsWHhkyvgfgS8jcC1Nit7Oow%2B9oAQiSX1dfOohXVNUwe8%2F1W3jjagU7xQfcq%2FvU5jpVHqP9%2FH%2Fg%3D52844268704f95b1678cc26d1c388883942a8c2d",
        "Hm_lpvt_cb09ebb4692b521604e77f4bf0a61013": "1698223420",
        "_ga_NHEPS49S4W": "GS1.2.1698222599.2.1.1698223420.0.0.0",
        "_qzja": "1.402745185.1698218091536.1698218091536.1698222597406.1698223363936.1698223420176.0.0.0.18.2",
        "_qzjb": "1.1698222597406.4.0.0.0",
        "_qzjto": "18.2.0",
        "_jzqb": "1.4.10.1698222597.1",
        "_fmdata": "Lgnmwvb9UZV3dOw7baJRkFLIcqZ0qBmuoEw2PbzMKQxBloJQrAqlHMCiqafNRvHdju3rC%2B7OEOuQt63BqwWxm9%2FK4QRRtyZfRLPU82er7og%3D",
        "JSESSIONID": "FF077F1DCE06D52EA72567D57950036B",
        "52710000|PC_clogin": "v=37&l=1698222597&e=1698225322171"
    }
    url = "http://www.lvmama.com/lvyou/ajax/getNewViewList"
    data = {
        "page_num": "2",
        "dest_id": "1",
        "base_id": "137",
        "request_uri": "/lvyou/scenery/d-beijing1.html"
    }
    response = requests.post(url, headers=headers, cookies=cookies, data=data,timeout=10, verify=False)

    # print(response.text)
    print(response)
    print(response.json()['data'])
    if response.status_code == 200:

        res = response.json()['data']
        return res


if __name__ == "__main__":
    get_viewlist()